import { applyMiddleware, createStore } from "redux";
import {Map} from 'immutable'
import reducer from './reducer'
import sagas from './sagas'
import  createSagaMiddleware from 'redux-saga'

const sagaMiddleware =createSagaMiddleware()
const store =createStore(
    reducer,
    Map({}),
    applyMiddleware (sagaMiddleware)
)

// sagaMiddleware.run(saga)
sagas.forEach(saga=>sagaMiddleware.run(saga))

export default store